#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
//#include <math.h>
using namespace std;


typedef struct
{
    short int x, y;
}coo;    
coo ans[10015];

bool comp(coo t1, coo t2)
{
    if (t1.x != t2.x) return t1.x < t2.x;
    else return t1.y < t2.y;
}    

int main()
{
	int a,b,x,y,n,i,j;
	
	
	
	for (i=0; i<10015; ++i)
	{
	    j = i%4;
	    switch (j)
	    {
	        case 0: 
             	x = i/2;
             	y = x;             	
             	break;
        	case 1:
        	    x = (i+1)/2;
        	    y = x;
                break;        	    
        	case 2:
        	    x = (i+2)/4 * 2;
        	    y = x - 2;
        	    break;
    	    case 3:
    	        x = (i+1)/4*2+1;
    	        y = x - 2;
    	        break;
	    }    
	    ans[i].x = x;
	    ans[i].y = y;
	}    
//	sort(ans,ans+10005,comp);	
//	for (i=0;i<20; ++i)
//		cout << ans[i].x << " " << ans[i].y << endl;
	cin >> n;
	
	while (n-->0)
	{
	    cin >> a >> b;
	    for (i=0; i<=10010; ++i)
	    	if (ans[i].x == a) break;
    	if (ans[i].y == b) 
    	{
    	    cout << i << endl;
    	    continue;
    	}    
    	j = i + 2;
    	if (ans[j].x == a && ans[j].y == b) 
    	{
    	    cout << j << endl;
    	    continue;
    	}    
    	cout << "No Number" << endl;
	  
	}    
    
    return 0;
}    


